<extend name="Public/base"/>
<block name="body">
    <div class="portlet box blue">
        <div class="portlet-title">
            <div class="caption"><i class="fa fa-reorder"></i>班级课程表</div>
            <div class="tools">
                <a href="" class="collapse"></a><a href="" class="remove"></a>
            </div>
        </div>
        <div class="portlet-body">

            <style>
                th,td{text-align: center;}
            </style>
            <form class="seme-form" action="{:U('')}" method="post">
            <div class="col-md-10" id="printArea">

                <div class="table-responsive">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <volist name="head_list" id="heads">
                                <th>{$heads.title}</th>
                            </volist>
                        </tr>
                        </thead>
                    </table>

                    <table class="table table-bordered">
                        <tbody>
                      <volist name="_list" id="data">
                        <tr>
                           <volist name="data" id="vos">
                            <td>{$vos.title}
                                <div class="pull-right">
                                 <input  type="checkbox" name="courses[]" value="{$vos.scid}"/>
                                </div>
                            </td>
                           </volist>
                        </tr>
                      </volist>
                        </tbody>
                    </table>

                </div>
            </div>

            <div class="col-md-2 text-right">
                <div class="margin-bottom-20">
                    <p class="text-center">选择学期</p>
                    <select name="sid" class="form-control">
                        <option value="">请选择</option>
                        <volist name="seme" id="svo">
                            <option value="{$svo.sid}">{$svo.title}</option>
                        </volist>
                    </select>
                </div>

                <button type="submit" target-form="seme-form" class="ajax-post btn green btn-block margin-bottom-20">保存</button>
                <input class="btn blue btn-block margin-bottom-10" value="打印 " id="btnPrint" onclick="onprint()">
            </div>
            </form>
            <div class="clearfix"></div>
        </div>
    </div>

</block>

<block name="script">

    <script src="__STATIC__/scripts/app.js"></script>
    <script src="__STATIC__/scripts/table-managed.js"></script>
    <script>
        jQuery(document).ready(function() {
            App.init();
            TableManaged.init();
            $('td').css('cursor','pointer');
            highlight_subnav('{:U('Courseware/teacheerhour')}');
        });

        function printHtml(html) {
            var bodyHtml = document.body.innerHTML;
            document.body.innerHTML = html;
            window.print();
            document.body.innerHTML = bodyHtml;
        }
        function onprint() {
            var html = $("#printArea").html();
            printHtml(html);
        }
    </script>
</block>